package ru.usu.gv.uicomponents.viewitems;

import javax.media.j3d.Appearance;
import javax.media.j3d.Material;
import javax.media.j3d.Transform3D;
import javax.media.j3d.TransformGroup;

import java.awt.Color;

/**
 @author Sergey Pupyrev 
 01.04.2007
 */

public abstract class ViewItemBase implements IViewItem
{
	private Appearance appearance;
	private Material material;
	private TransformGroup transformGroup;

	private Color color;
	private double size;

	public ViewItemBase(TransformGroup transformGroup, Appearance appearance, Material material)
	{
		this.transformGroup = transformGroup;
		this.appearance = appearance;
		this.material = material;
	}

	public double getSize()
	{
		return size;
	}

	public void setSize(double size)
	{
		this.size = size;
	}

	public Color getColor()
	{
		return color;
	}

	public void setColor(Color color)
	{
		this.color = color;
	}

	protected TransformGroup getTransformGroup()
	{
		return transformGroup;
	}

	protected Transform3D getTransform()
	{
		Transform3D transform = new Transform3D();
		transformGroup.getTransform(transform);
		return transform;
	}

	protected Appearance getAppearance()
	{
		return appearance;
	}

	protected Material getMaterial()
	{
		return material;
	}
}
